{template 'common/header'}

<title></title>
<style>
    .header-box{
        position: absolute;
        width: 100%;
        top: 0;
        height: 25%;
    }
    #main-box{
        position: absolute;
        width: 100%;
        top: 25%;
        height: 75% !important;
        overflow: auto;
    }
    #info-bar{
        position: absolute;
        width: 100%;
        bottom: 0;
    }
    .border-b-no{
        border-bottom: 0px;
    }
    #user-name{
        display: block;
        max-width: 50%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .user-box{
        max-width: 72%;
    }
</style>
<div class="xhq_body body_bg6">
    <div id="container" style="height:100%;">

        <div class="header-box">
            <div class="container-fluid vip-info-bg" id="info-box">
                <div class="user-head-pic pull-left margin-sm img-circle" style="overflow: hidden">
                    <img src="{$member['avatar']}" alt="" class="img-responsive " style="height: 100%">
                </div>
                <div class="container-fluid pull-left margin-sm user-box">
                    <ul class="list-unstyled vip-info-list">
                        <li><h6 class="pull-left">昵称：</h6><h6 id="user-name" class="pull-left">{$member['nickname']}</h6><h6 class="pull-left" style="margin-left: 10px"><a class="blue_font" href="{php echo $this->createMobileUrl('member/info')}">账号设置</a></h6></li>
                        <li><h6 class="pull-left">花名：</h6><h6 class="pull-left">{$member['commission']['levelname']}</h6></li>
                        <li><h6 class="pull-left">编号：</h6><h6 class="pull-left">{$member['id']}</h6></li>
                    </ul>
                </div>
            </div>
            <div class="container-fluid amount_detail_banner" id="info-bar">
                <div class="row">
                    <div class="col-xs-6 pull-left">
                        <div class="row border-right">
                            <h5 class="text-center white_font">{php echo empty($commissionSet['texts']['orderprice'])?'分销订单额':$commissionSet['texts']['orderprice']} : {php echo round($orderStatistics['o_status_1']['cg_money_sum'] + $orderStatistics['o_status_2']['cg_money_sum'] + $orderStatistics['o_status_3']['cg_money_sum'] , 2)}元</h5>
                        </div>
                    </div>
                    <div class="col-xs-6 pull-left">
                        <div class="row">
                            <h5 class="text-center white_font">{php echo empty($commissionSet['texts']['commission1'])?'分销佣金':$commissionSet['texts']['commission1']} : {$recordPrice['total']}元</h5>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="main-box" id="main-box" >
            <div class="container-fluid" id="vip_cont_box" >
                <div class="row">
                    <div class="container-fluid white-bg margin-sm">
                        <ul class="list-unstyled vip-center-list">
                        {if $member['agentid'] != 0}
                            <li class="padding-sm" style="text-align: center;">
                                <span class="col-xs-12">您是由【{$superior['nickname']}】推荐</span>
                            </li>
                        {else}
                            <li class="padding-sm" style="text-align: center;">
                                <span class="col-xs-12">您是由【{$set['shop']['name']}】推荐</span>
                            </li>
                        {/if}
                        </ul>
                    </div>
                    <div class="container-fluid white-bg margin-sm">
                        <div class="container-fluid no-padding">
                            <button class="text-left btn btn-block white-bg border-grey" type="button" onclick="show_detail(this)">
                                <span class="glyphicon glyphicon-triangle-bottom pull-left margin-r-xs"></span>{$commissionSet['texts']['myteam']}<span class="badge pull-right">{php echo $teamLists['all']}人</span>
                            </button>
                            <div class="collapse" id="collapseExample">
                                <div class="well white-bg">
                                    <ul class="list-unstyled vip-center-list">

                                        <li class="border-b-grey padding-sm">
                                            <a href="{php echo $this->createMobileUrl('member/myVip',array('level' => '1'))}">
                                                <span class="col-xs-2 glyphicon glyphicon-stats pull-left"></span>
                                                <span class="col-xs-7 pull-left">{php echo empty($commissionSet['texts']['myteam1'])?'一级下线':$commissionSet['texts']['myteam1']}</span>
                                                <span class="col-xs-3 pull-left red_font">{php echo $teamLists[1]}</span>
                                            </a>
                                        </li>
                                        <li class="border-b-grey padding-sm">
                                            <a href="{php echo $this->createMobileUrl('member/myVip',array('level' => '2'))}">
                                                <span class="col-xs-2 glyphicon glyphicon-stats pull-left"></span>
                                                <span class="col-xs-7 pull-left">{php echo empty($commissionSet['texts']['myteam2'])?'二级下线':$commissionSet['texts']['myteam2']}</span>
                                                <span class="col-xs-3 pull-left red_font">{php echo $teamLists[2]}</span>
                                            </a>
                                        </li>
                                        <li class="border-b-grey padding-sm ">
                                            <a href="{php echo $this->createMobileUrl('member/myVip',array('level' => '3'))}">
                                                <span class="col-xs-2 glyphicon glyphicon-stats pull-left"></span>
                                                <span class="col-xs-7 pull-left">{php echo empty($commissionSet['texts']['myteam3'])?'三级下线':$commissionSet['texts']['myteam3']}</span>
                                                <span class="col-xs-3 pull-left red_font">{php echo $teamLists[3]}</span>
                                            </a>
                                        </li>

                                        <!--<li class="border-b-grey padding-sm border-b-no">-->
                                            <!--<a href="{php echo $this->createMobileUrl('member/myVip',array('level' => '4'))}">-->
                                                <!--<span class="col-xs-2 glyphicon glyphicon-stats pull-left"></span>-->
                                                <!--<span class="col-xs-7 pull-left">{php echo empty($set['texts']['special'])?'我的特使':$set['texts']['special']}</span>-->
                                                <!--<span class="col-xs-3 pull-left red_font">{php echo $teamLists[4]}</span>-->
                                            <!--</a>-->
                                        <!--</li>-->
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="container-fluid white-bg margin-sm">
                        <div class="container-fluid no-padding">
                            <button class="text-left btn btn-block white-bg border-grey" type="button" onclick="show_detail(this)">
                                <span class="glyphicon glyphicon-triangle-bottom pull-left margin-r-xs"></span>{php echo empty($commissionSet['texts']['order'])?'分销订单':$commissionSet['texts']['order']}<span class="badge pull-right">{php echo $orderStatistics['o_status_0']['order_count'] + $orderStatistics['o_status_1']['order_count'] + $orderStatistics['o_status_2']['order_count'] + $orderStatistics['o_status_3']['order_count'] }单(￥{php echo round($orderStatistics['o_status_0']['cg_money_sum'] + $orderStatistics['o_status_1']['cg_money_sum'] + $orderStatistics['o_status_2']['cg_money_sum'] + $orderStatistics['o_status_3']['cg_money_sum'] , 2)})</span>
                            </button>
                            <div class="collapse" id="collapseExample1">
                                <div class="well white-bg">
                                    <ul class="list-unstyled vip-center-list">
                                        <li class="border-b-grey padding-sm">
                                            <a href="{php echo $this->createMobileUrl('member/orderx',array('status' => '0'))}">
                                                <span class="col-xs-6 pull-left ">下单未付款</span>
                                                <span class="col-xs-6 pull-left red_font text-right">{$orderStatistics['o_status_0']['order_count']}(￥{php echo round($orderStatistics['o_status_0']['cg_money_sum'], 2)})</span>
                                            </a>
                                        </li>
                                        <li class="border-b-grey padding-sm">
                                            <a href="{php echo $this->createMobileUrl('member/orderx',array('status' => '1'))}">
                                                <span class="col-xs-6 pull-left ">下单已付款</span>
                                                <span class="col-xs-6 pull-left red_font text-right">{$orderStatistics['o_status_1']['order_count']}(￥{php echo round($orderStatistics['o_status_1']['cg_money_sum'], 2)})</span>
                                            </a>
                                        </li>
                                        <li class="border-b-grey padding-sm">
                                            <a href="{php echo $this->createMobileUrl('member/orderx',array('status' => '2'))}">
                                                <span class="col-xs-6 pull-left ">下单已发货</span>
                                                <span class="col-xs-6 pull-left red_font text-right">{$orderStatistics['o_status_2']['order_count']}(￥{php echo round($orderStatistics['o_status_2']['cg_money_sum'], 2)})</span>
                                            </a>
                                        </li>
                                        <li class="border-b-grey padding-sm border-b-no">
                                            <a href="{php echo $this->createMobileUrl('member/orderx',array('status' =>'3'))}">
                                                <span class="col-xs-6 pull-left">订单已完成</span>
                                                <span class="col-xs-6 pull-left red_font text-right">{$orderStatistics['o_status_3']['order_count']}(￥{php echo round($orderStatistics['o_status_3']['cg_money_sum'], 2)})</span>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="container-fluid white-bg margin-sm">
                        <div class="container-fluid no-padding">
                            <button class="text-left btn btn-block white-bg border-grey" type="button" onclick="show_detail(this)">
                                <span class="glyphicon glyphicon-triangle-bottom pull-left margin-r-xs"></span>{php echo empty($commissionSet['texts']['commission1'])?'分销佣金':$commissionSet['texts']['commission1']}<span class="badge pull-right">{$recordPrice['total']}元</span>
                            </button>
                            <div class="collapse" id="collapseExample2">
                                <div class="well white-bg">
                                    <ul class="list-unstyled vip-center-list">
                                        <li class="border-b-grey padding-sm" style="display: none">
                                            <span class="col-xs-7 pull-left">待完成业绩</span>
                                            <span class="col-xs-5 pull-left red_font text-right">{$recordPrice['unfinish']}</span>
                                        </li>
                                        <li class="border-b-grey padding-sm">
                                            <span class="col-xs-7 pull-left">待结算业绩</span>
                                            <span class="col-xs-5 pull-left red_font text-right">{$recordPrice['lock']}</span>
                                        </li>
                                        <li class="border-b-grey padding-sm">
                                            <span class="col-xs-7 pull-left">已提现业绩</span>
                                            <span class="col-xs-5 pull-left red_font text-right">{$recordPrice['pay']}</span>
                                        </li>
                                        <li class="border-b-grey padding-sm">
                                            <span class="col-xs-7 pull-left">可提现业绩</span>
                                            <span class="col-xs-5 pull-left red_font text-right">{$recordPrice['ok']}</span>
                                        </li>
                                        <li class="border-b-grey padding-sm">
                                            <span class="col-xs-7 pull-left">被驳回业绩</span>
                                            <span class="col-xs-5 pull-left red_font text-right">{$recordPrice['invalid']}</span>
                                        </li>
                                        <li class="border-b-grey padding-sm">
                                            <span class="col-xs-7 pull-left">申请中业绩</span>
                                            <span class="col-xs-5 pull-left red_font text-right">{$recordPrice['apply']}</span>
                                        </li>
                                        <li class="border-b-grey padding-sm border-b-no">
                                            <span class="col-xs-7 pull-left">待打款业绩</span>
                                            <span class="col-xs-5 pull-left red_font text-right">{$recordPrice['check']}</span>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="container-fluid white-bg margin-sm">
                        <div class="container-fluid no-padding">
                            <a style="margin-top:0px;" class="btn white-bg col-xs-12 h4 border-grey" id="btnwithdraw">申请提现</a>
                        </div>
                    </div>

                    <div class="container-fluid white-bg margin-sm">
                        <div class="container-fluid no-padding">
                            <a style="margin-top:0px;" class="btn white-bg col-xs-12 h4 border-grey" id="btnwithdrawList" href="{php echo $this->createPluginMobileUrl('commission/log')}">提现记录</a>
                        </div>
                    </div>

                    <div style="height:46px;"></div>

                </div>
            </div>
        </div>
    </div>

    <script type="text/html" id="tpl_show_message"></script>

    <script language="javascript">
        require(['tpl', 'core'], function(tpl, core) {
            $(function(){
                $('#btnwithdraw').click(function(){
                    var mine = parseInt("{$recordPrice['ok']}");
                    var withdraw = parseInt("{php echo $commissionSet['withdraw']}");
                    if(mine > 0){
                        if(mine < withdraw){
                            core.tip.show('提现申请请在每周一发起。');
                            return false;
                        }else{
                            location.href = "{php echo $this->createPluginMobileUrl('commission/apply')}";
                        }
                    }else{
                        core.tip.show('很抱歉，没有可以提现的佣金');
                    }
                });
            });
        });
    </script>
    <script>
        function show_detail(e){
            $(e).next('.collapse').toggle();
        }
    </script>
    {php $show_footer=true}
    {php $footer_current='member'}
    {template 'common/footer'}